﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList list = new ArrayList();

            list.Add("Banana");
            list.Add("Orange");
            list.Add("Apple");

            Console.WriteLine("");

            Console.WriteLine("水果的种类有{0}种",list.Count);
            Console.WriteLine("这里的水果分别有：");
            foreach (var item in list)   
            {
                Console.WriteLine(item);
            }
            Console.WriteLine("如果没有您爱吃的水果欢迎反馈\n 请说出你喜欢的水果");
            string fruits=Console.ReadLine();

            if (fruits!=null)
            {
                list.Add(fruits);
            }
            else
            {
                Console.WriteLine("水果名不能为空");
            }


            Console.WriteLine("经过你的反馈，我们已经添加该水果");
            Console.WriteLine("现在我们店里的水果种类有{0}种",list.Count);
            foreach (var item in list)
            {
                Console.WriteLine(item);
            }
                    
        }
    }
}
